package com.vpclub.dao;

import com.vpclub.bean.Employee;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author : leimingchao
 * @date Date : 2021年08月06日 0:16
 */
public interface EmployeeDaoAnnotation {


    /**
     *根据id查询员工
     * @return
     */
    @Select(value = "select * from t_employee where id = #{id}")
    Employee getEmployeeById(Integer id);

    /**
     * 更新员工
     * @param employee
     * @return
     */
    @Update(value = " update t_employee set empname=#{empName},gender=#{gender},email=#{email} where id=#{id}")
    int updateEmployee(Employee employee);

    @Delete(value = "delete from t_employee where id=#{id}")
    boolean deleteEmployee(Integer id);

    @Insert(value = "insert into t_employee(empname,gender,email) values (#{empName},#{gender},#{email})")
    int insertEmployee(Employee employee);
}
